<?php
class AccueilController extends Controller{

	function index($region){
	/*	if ($region = 0){
			$this->loadModel('Accueil');
			$condition = array('numRegion' => 0);
			$d['accueils'] = $this->Accueil->find(array(
				'conditions' => $condition
					));
			$this->set($d);

		}else{*/
			$this->loadModel('Accueil');
			$condition = array('numRegion' => $region);
			$d['accueils'] = $this->Accueil->find(array(
				'conditions' => array( 'numRegion' => $region)
					));
			$result = $d;
			//var_dump($result);
			if ($region !=0){
			echo json_encode($result);	
			}
			//exit();
			//}
		}



	function view($id,$slug){
		/*$this->loadModel('Actualite');
		
		$d['actus'] = $this->Actualite->findFirst( array(
			'fields' 	 => 'idActualite,slug,description,titre',
			'conditions' => array('online' => 1,'idActualite'=>$id,'type'=>'actu') 
				));
		
		if(empty($d['actus'])){
			$this->e404('Page introuvable');
		}
		if ($slug != $d['actus']->slug) {
			$this->redirect("actus/view/$id/".$d['actus']->slug,301);
		}

		$this->set($d);*/
	}


}
?>